package com.jctrip.hotel.source.model.meituan;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author: zxy
 * @CreateTime: 2023-12-25 16:19
 * @Description:
 */
@Getter
public enum MeituanEnum {
    POI_LIST("hotel.poi.list", "查询酒店id列表"),
    GOODS_RP("hotel.goods.rp", "查询酒店下产品列表"),
    CITY_SUGGEST("hotel.city.suggest", "目的地搜索"),
    KEYWORD_SUGGEST("hotel.keyword.suggest", "关键词搜索"),
    POI_LIST_SEARCH("hotel.poi.list.search", "列表页搜索"),
    SHOPPING_MULTI("hotel.shopping.multi", "查询酒店列表页"),
    SHOPPING_AVAIL("hotel.shopping.avail", "查询实时酒店内产品信息"),
    CONTENT("hotel.content", "查询酒店详情V2"),
    REALROOM_CONTENT("hotel.realroom.content", "查询物理房型V2"),
    ORDER_CHECK("hotel.order.check", "下单前校验"),
    ORDER_BOOKING("hotel.order.booking", "预约下单"),
    ORDER_CANCEL("hotel.order.cancel", "取消订单"),
    ORDER_QUERY("hotel.order.query", "查询订单"),
    ORDER_REMINDER("hotel.order.reminder", "酒店催单"),
    ;

    private final String code;
    private final String msg;

    MeituanEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static MeituanEnum getByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        for (MeituanEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
